package com.gitee.minimalismstyle.fresh.common.document.domain

import com.gitee.minimalismstyle.fresh.common.document.xml.AbcToIntXmlAdapter
import javax.xml.bind.annotation.XmlAccessType
import javax.xml.bind.annotation.XmlAccessorType
import javax.xml.bind.annotation.XmlAttribute
import javax.xml.bind.annotation.XmlElement
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter

@XmlAccessorType(XmlAccessType.FIELD)
data class Property(@XmlAttribute var name: String? = null) {

    @XmlAttribute
    var type: String? = null

    @XmlAttribute
    var start:Int? = null

    @XmlAttribute
    var end:Int? = null

    @XmlAttribute
    @XmlJavaTypeAdapter(AbcToIntXmlAdapter::class)
    var col: Int? = null

    @XmlAttribute
    var row: Int? = null

    @XmlAttribute
    var pattern: String? = null

    @XmlAttribute
    var conversion: String? = null

    @XmlAttribute
    var default: String? = null

    @XmlElement(name = "validate")
    var validates: List<Validate> = arrayListOf()

    @XmlElement(name = "property")
    var propertys: List<Property> = arrayListOf()

}